import { TypeCssGlobalVariableEnum } from "./util_type.ts";

const cssMap=new Map<TypeCssGlobalVariableEnum,string>();

function getCssGlobalVariables(){
    
    //console.log(JSON.stringify(TypeCssGlobalVariableEnum));
    
    Object.entries(TypeCssGlobalVariableEnum).forEach(entry=>{
        // console.log(entry);
        const key='--'+entry[1].trim();
        //console.log('key ='+key);
        const cssValue= getComputedStyle(document.documentElement).getPropertyValue(key);
        //console.log('cssValue',JSON.stringify(cssValue));
        cssMap.set(entry[1] as TypeCssGlobalVariableEnum,cssValue);
        
    })
   
    

    return cssMap;
}

const cssGlobalVariableMap=getCssGlobalVariables();


export {cssGlobalVariableMap}
